package com.mall.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.mall.db.domain.FeedBack;
import com.mall.db.service.FeedBackService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author wxd
 * @since 2021-09-24
 */
@RestController
@RequestMapping("/system/fbc")
public class FeedBackController extends BaseController<FeedBack>{
    @Resource(name = "feedBackService")
    private FeedBackService fbs;

    @Override

    public Map<String, Object> find(FeedBack feedBack) {

        //实现分页
        PageHelper.startPage(feedBack.getPage(), feedBack.getLimit());

        QueryWrapper<FeedBack> qw = new QueryWrapper<>();

        List<FeedBack> list = fbs.list(qw);

        PageInfo<FeedBack> page = new PageInfo<>(list,feedBack.getLimit());

        return this.findMap(page.getList(),page.getTotal());
    }


}

